<?php
class Admin_Form_UserRemain extends Zend_Form {

	protected $_remain;
	protected $_submit;
	protected $_user;

	public function init() {
		$this->_remain = new Zend_Form_Element_Text('remain');
		$this->_remain->setLabel('Remain');
		$this->_submit = new Zend_Form_Element_Submit('submit');
		$this->_submit->setLabel('Update');
		$this->_user = new Zend_Form_Element_Hidden('user');
		$this->_user->setName('user');
		$this->addElements(array($this->_remain, $this->_user, $this->_submit));
	}

	public function bindData($users) {
		if (isset($user->_remain)) {
			$this->_remain->setValue($user->_remain);
		}
	}

	public function populateData(Front_Model_User $user) {
		if (isset($user->_remain)) {
			$this->_remain->setValue($user->_remain);
		}
		if (isset($user->_uid)) {
			$this->_user->setValue($user->_uid);
		}
	}
}